 package com.nq.controller.backend;


 import com.nq.common.ServerResponse;
 import com.nq.pojo.SiteSetting;
 import com.nq.pojo.StHolidays;
 import com.nq.pojo.StHolidaysPo;
 import com.nq.service.ISiteSettingService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;


 @Controller
 @RequestMapping({"/admin/set/"})
 public class AdminSiteSettingController {
     private static final Logger log = LoggerFactory.getLogger(AdminSiteSettingController.class);

     @Autowired
     ISiteSettingService iSiteSettingService;

     //修改风控设置 股票风控信息
     @RequestMapping({"update.do"})
     @ResponseBody
     public ServerResponse update(SiteSetting siteSetting) {
         return this.iSiteSettingService.update(siteSetting);
     }

     @RequestMapping({"queryHoliday.do"})
     @ResponseBody
     public ServerResponse queryHoliday(@RequestParam("name") String name,
                                        @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
                                        @RequestParam(value = "pageSize", defaultValue = "10") int pageSize

     ) {
         return this.iSiteSettingService.queryHoliday(name, pageNum, pageSize);
     }

     @RequestMapping({"addHoliday.do"})
     @ResponseBody
     public ServerResponse addHoliday(StHolidaysPo holidays) {
         return this.iSiteSettingService.addHoliday(holidays);
     }
     @RequestMapping({"updateHoliday.do"})
     @ResponseBody
     public ServerResponse updateHoliday(StHolidaysPo holidays) {
         return this.iSiteSettingService.updateHoliday(holidays);
     }
     @RequestMapping({"delHoliday.do"})
     @ResponseBody
     public ServerResponse delHoliday(@RequestParam("id") Integer id) {
         return this.iSiteSettingService.delHoliday(id);
     }
 }